home *** CD-ROM | disk | FTP | other *** search
- Path: news1.h1.usa.pipeline.com!usenet
- From: grantp@usa.pipeline.com(Pete)
- Newsgroups: comp.lang.c++
- Subject: Re: Q about DLL's with Borland C++ 4.0
- Date: 4 Jan 1996 12:50:18 GMT
- Organization: Pipeline USA
- Message-ID: <4cgiea$mnf@news1.usa.pipeline.com>
- NNTP-Posting-Host: pipe8.h1.usa.pipeline.com
- X-PipeUser: grantp
- X-PipeHub: usa.pipeline.com
- X-PipeGCOS: (Pete)
- X-Newsreader: Pipeline USA v3.3.0
-
- On Jan 04, 1996 11:29:48 in article <Q about DLL's with Borland C++ 4.0>,
- 'Daniel Kobler <kobler@dma.epfl.ch>' wrote:
-
-
- >Hello !
- >
- >My problem is the following: I have functions in 4 files (*.c because they
-
- >are written in C, but this not important), with a header file for each of
- >these files (*.h, contains the headers of the functions in the
- corresponding
- >*.c), and a fifth header file that contains the #define, typedef, ....
- >One of these functions, called production, needs to be called by a macro
- of
- >Excel. Therefore I made a DLL of these files, with the line
- >void _export production(...);
- >in file1.h (if the function is in file1.c).
- >The macro of Excel recognizes the DLL, but says the function production
- does
- >not exist in that DLL. What did I do wrong? Have I forgotten a key-word?
- Or
- >is this "void _export production(...);" misplaced?
- >
- 1. Wrap your exported function declarations with extern "C".
-
- 2. Use the PASCAL keyword in those functions.
-
- 1 is to suppress C++ name mangling -- not applicable if
- your source code is straight C. 2 converts all names to
- upper case and suppresses the underscore prefixing normally
- done to C symbols.
-
- Oops, just reread your message -- 1 is not applciable to you.
-
- Pete
-